#include "stdafx.h"

#include "gtest/gtest.h"
#include "domino.h"

TEST(domino, createDomino) {
	_CrtMemState _ms;
	_CrtMemCheckpoint(&_ms);
	{
		dgame::Domino domino(0,0);
		int leftdomino = domino.getLeft();
		int rightdomino = domino.getRight();
		ASSERT_EQ(leftdomino, 0);
		ASSERT_EQ(rightdomino, 0);
	}
	{
		dgame::Domino domino(2,1);
		int leftdomino = domino.getLeft();
		int rightdomino = domino.getRight();
		ASSERT_EQ(leftdomino, 1);
		ASSERT_EQ(rightdomino, 2);
	}
	{
		dgame::Domino domino(1,2);
		int leftdomino = domino.getLeft();
		int rightdomino = domino.getRight();
		ASSERT_EQ(leftdomino, 1);
		ASSERT_EQ(rightdomino, 2);
	}
	_CrtMemDumpAllObjectsSince(&_ms);
}

TEST(domino,equalsDomino) {
	_CrtMemState _ms;
	_CrtMemCheckpoint(&_ms);
	{
		dgame::Domino domino1(1,2);
		dgame::Domino domino2(2,1);
		dgame::Domino domino3(1,3);
		ASSERT_TRUE(domino1 == domino2);
		ASSERT_FALSE(domino1 == domino3);
	}
	_CrtMemDumpAllObjectsSince(&_ms);
}
